# 用户下的蓝图模块
from flask import Blueprint
from flask_restful import Api  # 创建资源
from comment.utils.output import output_json

# 创建蓝图
user_bp = Blueprint('users', __name__, url_prefix='/user')
# 把资源创建出来
user_api = Api(user_bp)
# 使用里面的方法采用的室json数据格式，json数据格式采用output里的
user_api.representation('application/json')(output_json)

# 加载当前模块的资源
from Shopping.resources.user.user_resource import Shopping_User, User_SMS, AuthorizationCodeResource, \
    RegisterUserResource, UserLoginResource, IsExistPhoneResource, UserLoginOutResource

user_api.add_resource(Shopping_User, '/hello', endpoint='user')  # 普通测试
user_api.add_resource(User_SMS, '/sms', endpoint='sms')  # 验证码
user_api.add_resource(AuthorizationCodeResource, '/authorization', endpoint='authorization')
user_api.add_resource(RegisterUserResource, '/register', endpoint='register')
user_api.add_resource(UserLoginResource, '/login', endpoint='login')
user_api.add_resource(UserLoginOutResource, '/loginOut', endpoint='loginOut')
user_api.add_resource(IsExistPhoneResource, '/isExist', endpoint='isExist')
